
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>常用的布局组件 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="section6.html" />
    
    
    <link rel="prev" href="section4.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../chapter1/">
            
                <a href="../chapter1/">
            
                    
                    Flutter vs React Native
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="../chapter2/">
            
                <a href="../chapter2/">
            
                    
                    环境配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.2.1" data-path="../chapter2/section1.html">
            
                <a href="../chapter2/section1.html">
            
                    
                    前置依赖环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2.2" data-path="../chapter2/section2.html">
            
                <a href="../chapter2/section2.html">
            
                    
                    配置 Android 环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2.3" data-path="../chapter2/section3.html">
            
                <a href="../chapter2/section3.html">
            
                    
                    配置 Flutter 环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2.4" data-path="../chapter2/section4.html">
            
                <a href="../chapter2/section4.html">
            
                    
                    创建并运行 Flutter 项目
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="./">
            
                <a href="./">
            
                    
                    核心Widget的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.1" data-path="section3.html">
            
                <a href="section3.html">
            
                    
                    MaterialApp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.2" data-path="section1.html">
            
                <a href="section1.html">
            
                    
                    Text
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.3" data-path="section2.html">
            
                <a href="section2.html">
            
                    
                    Center
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.4" data-path="section4.html">
            
                <a href="section4.html">
            
                    
                    Scaffold
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.1.3.5" data-path="section5.html">
            
                <a href="section5.html">
            
                    
                    常用的布局组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.6" data-path="section6.html">
            
                <a href="section6.html">
            
                    
                    AppBar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.7" data-path="section7.html">
            
                <a href="section7.html">
            
                    
                    TabBar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.8" data-path="section8.html">
            
                <a href="section8.html">
            
                    
                    TabController
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.9" data-path="section9.html">
            
                <a href="section9.html">
            
                    
                    TabBarView
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.10" data-path="section10.html">
            
                <a href="section10.html">
            
                    
                    Drawer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.11" data-path="section11.html">
            
                <a href="section11.html">
            
                    
                    UserAccountsDrawerHeader
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.12" data-path="section12.html">
            
                <a href="section12.html">
            
                    
                    ListView
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.13" data-path="section13.html">
            
                <a href="section13.html">
            
                    
                    CircleAvatar
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.4" data-path="../chapter4/">
            
                <a href="../chapter4/">
            
                    
                    自定义 Widget
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.4.1" data-path="../chapter4/section1.html">
            
                <a href="../chapter4/section1.html">
            
                    
                    StatelessWidget
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4.2" data-path="../chapter4/section2.html">
            
                <a href="../chapter4/section2.html">
            
                    
                    StatefulWidget
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.5" data-path="../chapter5/">
            
                <a href="../chapter5/">
            
                    
                    事件绑定
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.6" data-path="../chapter6/">
            
                <a href="../chapter6/">
            
                    
                    dio 数据请求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.7" data-path="../chapter7/">
            
                <a href="../chapter7/">
            
                    
                    路由导航
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8" data-path="../chapter8/">
            
                <a href="../chapter8/">
            
                    
                    修改 App 名称和图标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.9" data-path="../chapter9/">
            
                <a href="../chapter9/">
            
                    
                    打包发布 Android 项目
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.10" data-path="../chapter10/">
            
                <a href="../chapter10/">
            
                    
                    项目中用到的资源
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >常用的布局组件</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5E38;&#x7528;&#x7684;&#x5E03;&#x5C40;&#x7EC4;&#x4EF6;">&#x5E38;&#x7528;&#x7684;&#x5E03;&#x5C40;&#x7EC4;&#x4EF6;</h1>
<h2 id="container">Container</h2>
<p>&#x5E38;&#x7528;&#x7684;&#x5C5E;&#x6027;&#xFF1A;</p>
<ul>
<li><p>child&#x3010;&#x5B50;&#x8282;&#x70B9;&#x3011;</p>
</li>
<li><p>padding&#x3010;&#x5185;&#x5BB9;&#x8DDD;&#x79BB;&#x76D2;&#x5B50;&#x8FB9;&#x754C;&#x7684;&#x8DDD;&#x79BB;&#x3011;</p>
<p>&#x4E3E;&#x4F8B;&#xFF1A;<code>padding: EdgeInsets.all(10)</code></p>
</li>
<li><p>margin &#x3010;&#x76D2;&#x5B50;&#x8FB9;&#x754C;&#x4E4B;&#x5916;&#x7684;&#x8DDD;&#x79BB;&#x3011;</p>
<p>&#x4E3E;&#x4F8B;&#xFF1A;<code>margin: EdgeInsets.all(10)</code></p>
</li>
<li><p>decoration&#x3010;&#x76D2;&#x5B50;&#x7684;&#x88C5;&#x9970;&#x3011;</p>
<p>&#x4E3E;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-dart">decoration: BoxDecoration(
    color: Colors.red,
    border: Border(bottom: BorderSide(width: <span class="hljs-number">5</span>, color: Colors.cyan)))
</code></pre>
</li>
</ul>
<h2 id="row">Row</h2>
<p>&#x4F7F;&#x5185;&#x90E8;&#x7684; children &#x5B50;&#x5143;&#x7D20;&#x6A2A;&#x5411;&#x5E03;&#x5C40;</p>
<p>&#x5C5E;&#x6027;&#xFF1A;</p>
<ul>
<li><p>children&#x3010;&#x5B50;&#x5143;&#x7D20;&#x3011;</p>
</li>
<li><p>mainAxisAlignment&#x3010;&#x6A2A;&#x5411;&#x5BF9;&#x5176;&#x65B9;&#x5F0F;&#x3011;</p>
</li>
<li><p>crossAxisAlignment&#x3010;&#x7EB5;&#x5411;&#x5BF9;&#x5176;&#x65B9;&#x5F0F;&#x3011;</p>
</li>
</ul>
<h2 id="column">Column</h2>
<p>&#x4F7F;&#x5185;&#x90E8;&#x7684; children &#x5B50;&#x5143;&#x7D20;&#x7EB5;&#x5411;&#x5E03;&#x5C40;</p>
<p>&#x5C5E;&#x6027;&#xFF1A;</p>
<ul>
<li><p>children&#x3010;&#x5B50;&#x5143;&#x7D20;&#x3011;</p>
</li>
<li><p>mainAxisAlignment&#x3010;&#x7EB5;&#x5411;&#x5BF9;&#x5176;&#x65B9;&#x5F0F;&#x3011;</p>
</li>
<li><p>crossAxisAlignment&#x3010;&#x6A2A;&#x5411;&#x5BF9;&#x5176;&#x65B9;&#x5F0F;&#x3011;</p>
</li>
</ul>
<h2 id="expanded">Expanded</h2>
<p>&#x4E3B;&#x8981;&#x7528;&#x6765;&#x63A7;&#x5236; flex &#x5E03;&#x5C40;&#x7684;&#x5360;&#x4F4D;&#x5BBD;&#x5EA6;&#x3002;</p>
<p>&#x9700;&#x8981;&#x7528;&#x5728; <code>Row</code> &#x6216; <code>Column</code> &#x5B50;&#x7EC4;&#x4EF6;&#x5185;&#x90E8;&#x3002;</p>
<p>&#x4E3E;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-dart">Row(
  children: &lt;Widget&gt;[
    Expanded(child: Text(<span class="hljs-string">&apos;&#x4E3B;&#x4F53;&#x5185;&#x5BB9;1&apos;</span>), flex: <span class="hljs-number">2</span>,),
    Expanded(child: Text(<span class="hljs-string">&apos;&#x4E3B;&#x4F53;&#x5185;&#x5BB9;2&apos;</span>), flex: <span class="hljs-number">1</span>,)
  ]
)
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="section4.html" class="navigation navigation-prev " aria-label="Previous page: Scaffold">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="section6.html" class="navigation navigation-next " aria-label="Next page: AppBar">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"常用的布局组件","level":"1.1.3.5","depth":3,"next":{"title":"AppBar","level":"1.1.3.6","depth":3,"path":"chapter3/section6.md","ref":"chapter3/section6.md","articles":[]},"previous":{"title":"Scaffold","level":"1.1.3.4","depth":3,"path":"chapter3/section4.md","ref":"chapter3/section4.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"chapter3/section5.md","mtime":"2018-12-12T13:25:27.393Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-12-17T10:25:33.898Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

